Skip to content

fix(ts-sdk): align execution price calculation - #2029

Open
Purin1410 wants to merge 1 commit into
pmxt-dev:mainfrom
Purin1410:fix/1460-execution-price
Open

Purin1410 wants to merge 1 commit into
pmxt-dev:mainfrom
Purin1410:fix/1460-execution-price

Conversation

@Purin1410

Copy link
Copy Markdown

Summary

  • Reuse getExecutionPriceDetailed in the TypeScript helper.
  • Sort levels consistently, ignore non-positive sizes, and preserve the 0 result when liquidity is insufficient.

Test plan

  • npm test --workspace=pmxtjs -- --runInBand tests/execution-price-detailed-local.test.ts
  • npm test --workspace=pmxtjs -- --runInBand
  • npm run build --workspace=pmxtjs
  • git diff --check origin/main...HEAD

Note

Amounts less than or equal to zero now use the detailed helper's existing validation behavior.

Fixes #1460

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SDK drift: TypeScript getExecutionPrice doesn't sort/filter order book levels, unlike getExecutionPriceDetailed and unlike Python's get_execution_price

1 participant